import request from '@/utils/request'

// 查询参数列表
export function listExamConfig(query) {
  return request({
    url: '/exam/config/list',
    method: 'get',
    params: query
  })
}

// 新增参数配置
export function addExamConfig(data) {
  return request({
    url: '/exam/config/add',
    method: 'post',
    data: data
  })
}

// 修改参数配置
export function updateExamConfig(data) {
  return request({
    url: '/exam/config/edit',
    method: 'post',
    data: data
  })
}


// 查询参数详细
export function getExamConfig(configId) {
  return request({
    url: '/exam/config/' + configId,
    method: 'get'
  })
}


// 删除参数配置
export function delExamConfig(configId) {
  return request({
    url: '/exam/config/' + configId,
    method: 'delete'
  })
}



// 保存测评角色
export function updateExamRole(data) {
  return request({
    url: '/roleExam/authRole',
    method: 'post',
    params: data
  })
}

// 查询参数详细
export function getExamRole(configId) {
  return request({
    url: '/roleExam/authRole/' + configId,
    method: 'get'
  })
}


//===================================================================================

// 查询参数列表
export function listDomain(query) {
  return request({
    url: '/domain/list',
    method: 'get',
    params: query
  })
}

// 新增参数配置
export function addDomain(data) {
  return request({
    url: '/domain/add',
    method: 'post',
    data: data
  })
}


// 查询参数详细
export function getDomain(configId) {
  return request({
    url: '/domain/' + configId,
    method: 'get'
  })
}


// 修改参数配置
export function updateDomain(data) {
  return request({
    url: '/domain/edit',
    method: 'post',
    data: data
  })
}


// 删除参数配置
export function delDomain(configId) {
  return request({
    url: '/domain/' + configId,
    method: 'delete'
  })
}

//===================================================================================


// 查询参数列表
export function listQuestion(query) {
  return request({
    url: '/question/list',
    method: 'get',
    params: query
  })
}


// 新增参数配置
export function addQuestion(data) {
  return request({
    url: '/question/add',
    method: 'post',
    data: data
  })
}


// 查询参数详细
export function getQuestion(configId) {
  return request({
    url: '/question/' + configId,
    method: 'get'
  })
}


// 修改参数配置
export function updateQuestion(data) {
  return request({
    url: '/question/edit',
    method: 'post',
    data: data
  })
}


// 删除参数配置
export function delQuestion(configId) {
  return request({
    url: '/question/' + configId,
    method: 'delete'
  })
}


//===================================================================================
// 查询知识领域
export function listDictDomain() {
  return request({
    url: '/exam/dict/domain',
    method: 'get',
  })
}

// 查询题目难度
export function listDictLevel() {
  return request({
    url: '/exam/dict/level',
    method: 'get',
  })
}

// 查询题目类型
export function listDictQuType() {
  return request({
    url: '/exam/dict/quType',
    method: 'get',
  })
}

// 查询测评批次
export function listDictExamConfig() {
  return request({
    url: '/exam/dict/examConfig',
    method: 'get',
  })
}

//===================================================================================

// 查询知识领域
export function listScore(query) {
  return request({
    url: '/answer/score/list',
    method: 'get',
    params: query
  })
}


// 查询知识领域
export function getScoreDetails(query) {
  return request({
    url: '/answer/score/details',
    method: 'get',
    params: query
  })
}

